<template>
  <div>

    <!-- 轮播图页面 -->
    <van-swipe  class="my-swipe" :autoplay="3000" @change="onChange">
      <van-swipe-item v-for="(image, index) in images" :key="index">
      <img v-lazy="image" />
      </van-swipe-item>
    </van-swipe>
    <!-- 保险商品 -->
    <van-card
      num="1"
      price="109"
      desc="突破体育男款球衣-DX00015"
      title="【定制】"
      :thumb="getImg()"
      origin-price='125'
      class="VanCart"
    />
  </div>
</template>

<script>
export default {
  name: 'cmpt-customize',
  data () {
    return {
      images: [
        require('@/images/serve/customize/1.png'),
        require('@/images/serve/insurance/3.jpg'),
        require('@/images/serve/insurance/1.png')
      ]
    }
  },
  methods: {

    // 获取商品的图片方法getImg ()
    getImg () {
      return require('@/images/serve/customize/2.jpg')
    },
    onChange (index) {
      // this.$toast('当前 Swipe 索引：' + index)
    }
  }
}
</script>

<style scoped>
.my-swipe .van-swipe-item {
  width: 100%;
  height: 40vw;
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: #39a9ed;
}
 .my-swipe img{
  width: 100%;
  height: 100%;
}
</style>
